<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<style type="text/css">
			#container{
				width: 100%;
				height: 700px;
				display: flex;
				justify-content: center;
				align-items: center;
			}
			#outDiv{
				width: 600px;
				height: 500px;
				display: flex;
				align-items: center;
				overflow: hidden;
				
			}
			#imgListId{
				display: flex;
				width: 1600px;
				height: 100px;
			}
			#imgListId img{
				width: 100px;
				height: 100px;
			}
		</style>
	</head>
	<body>
		<div id="container">
			<div id="outDiv">
				<div id="imgListId" onmouseenter="mouseEnterAction();" onmouseleave="mouseLeaveAction();">
					<img src="img/1.jpeg" >
					<img src="img/2.jpeg" >
					<img src="img/3.jpeg" >
					<img src="img/4.jpeg" >
					<img src="img/5.jpeg" >
					<img src="img/6.jpeg" >
					<img src="img/7.jpeg" >
					<img src="img/8.jpeg" >
					<img src="img/9.jpeg" >
					<img src="img/10.jpeg" >
					<img src="img/1.jpeg" >
					<img src="img/2.jpeg" >
					<img src="img/3.jpeg" >
					<img src="img/4.jpeg" >
					<img src="img/5.jpeg" >
					<img src="img/6.jpeg" >
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var imgList=document.getElementById('imgListId');
		var marginLeft=0;
		var myInterval= null;
		
		function imgAction(){
			marginLeft--;
			imgList.style.marginLeft=marginLeft+'px';
			if(marginLeft==-1000){
				marginLeft=0
			}
			if(marginLeft%100==0){
				clearInterval(myInterval);
				setTimeout(function(){
					myInterval=setInterval(imgAction,10);
				},1000)
			}
		}
		onload=function(){
			myInterval=setInterval(imgAction,10);
		}
		function mouseEnterAction(){
			clearInterval(myInterval);
		}
		function mouseLeaveAction(){
			myInterval=setInterval(imgAction,10);
		}
	</script>
</html>
